#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int a, max=0;
	scanf("%d", &a);
	if (a == -1)
		printf("%d\n", a);
	else {
		max = a;
		do {
			scanf("%d", &a);
			if (a == -1)
				break;
			if (max < a)
				max = a;
		} while (1);
	}
	printf("%d\n", max);
	return 0;
}